//程序4：输入某年某月某日，判断这一天是这一年的第几天

#include "stdio.h"
int main(int argc, const char *argv[])
{
	char month_day[12]={31,28,31,30,31,30,31,31,30,31,30,31},i;
	short year,month,day;
	short sum=0;//天数和
	
	printf("\n请输入年月日（例如2020,5,24）：");
	scanf("%d,%d,%d",&year,&month,&day);
	for(i=0;i<month-1;i++)
	{
		sum+=month_day[i];
	}
	if(year%400==0&&year%4==0&&year%100!=0)
	{
		sum=sum+1;
		sum=sum+day;
	}
	else
		sum=sum+day;
	printf("\n您输入的是%d年的第%d天\n",year,sum);
	return 0;
}
